<!DOCTYPE html>
<html>

	<head>
		<meta charset="utf-8">
		<meta http-equiv="X-UA-Compatible" content="IE=edge">
		<title>魏远商城</title>
		<meta name="viewport" content="initial-scale=1, maximum-scale=1">
		<link rel="shortcut icon" href="/favicon.ico">
		<meta name="apple-mobile-web-app-capable" content="yes">
		<meta name="apple-mobile-web-app-status-bar-style" content="black">
		<link rel="stylesheet" href="css/my-order.css" />
		<link rel="stylesheet" href="css/style.css" />
	</head>

	<body style="background: #eaeef1;">
		<header class="bar bar-nav return-header" style="width: 100%;">
			<span class="mui-action-back order-back"><img src="img/back-le.png" height="50%"/></span>
			<h1 class="title" style="line-height: 2.2rem;">我的钱包</h1>
			<span class="wallet-list">账单</span>
		</header>

		<div class="my-coupon-content">
			<div class="wallet-money">
				<p>账户余额（元）</p>
				<p class="balance"></p>
			</div>
			<p id="my-wallet-recharge" class="my-wallet-recharge">
				<img src="img/wallet-recharge.png" alt="" height="50%" class="middle" />
				<span>充值</span>
				<img src="img/back-ri.png" alt="" height="50%" class="my-wallet-recharge-right-back" />
			</p>
		</div>

		<script src="js/mui.min.js" type="text/javascript" charset="utf-8"></script>
		<script src="js/jquery-3.1.1.min.js"></script>
		<script src="js/url.js" type="text/javascript" charset="utf-8"></script>
		<script type="text/javascript">
			var token = localStorage.token;
			//账单
			$('.wallet-list').on('tap', function() {
				click('my-bill.html', 'my-bill')
			})

			//'打开页面
			$('#my-wallet-recharge').on('tap', function() {
				click('my-wallet-recharge.html', 'my-wallet-recharge');
			})
			wallet();

			function wallet() {
				console.log('开始调用接口')
				$.ajax({
					url: ur + '/mobilemember/frontmember/accountPayList?time='+new Date(),
					type: 'post',
					dataType: 'json',
					headers: {
						'X-Token': token
					},
					data: '',
					success: function(data) {
						console.log(data);
//						alert(data.balance)
						$('.balance').text((data.balance).toFixed(2));
					},
					error: function(e) {}
				})
			}

			/*获取账户余额*/
//			getmoney();
//
//			function getmoney() {
//				$.ajax({
//						url: ur + '/mobilemember/shoppingcart/getMemberAcountBalance?time='+new Date(),
//						type: 'GET',
//						dataType: 'json',
//						headers: {
//							"X-Token": token
//						},
//						data: {}
//					})
//					.done(function(data) {
//						console.log(data);
//						$('.balance').text(data.value);
//					})
//
//			}
		</script>
	</body>

</html>